using System;
using System.ComponentModel;

using DevExpress.Xpo;
using DevExpress.Data.Filtering;

using DevExpress.ExpressApp;
using DevExpress.Persistent.Base;
using DevExpress.Persistent.BaseImpl;
using DevExpress.Persistent.Validation;

namespace TestPermission.Module
{
    [DefaultClassOptions]
    public class DomainObject1 : BaseObject
    {
        public DomainObject1(Session session)
            : base(session)
        {
            // This constructor is used when an object is loaded from a persistent storage.
            // Do not place any code here or place it only when the IsLoading property is false:
            // if (!IsLoading){
            //    It is now OK to place your initialization code here.
            // }
            // or as an alternative, move your initialization code into the AfterConstruction method.
        }
        private string _DomainName;
        [Custom("Caption", "DomainName")]
        public string DomainName
        {
            get { return _DomainName; }
            set { SetPropertyValue<string>("DomainName", ref _DomainName, value); }
        }

        public override void AfterConstruction()
        {
            base.AfterConstruction();
            // Place here your initialization code.
        }
    }

    [DefaultClassOptions]
    public class Document : BaseObject
    {
        public Document(Session session) : base(session) { }

        public string AvailableProperty
        {
            get { return GetPropertyValue<string>("AvailableProperty"); }
            set { SetPropertyValue<string>("AvailableProperty", value); }
        }
        public string ReadOnlyProperty
        {
            get { return GetPropertyValue<string>("ReadOnlyProperty"); }
            set { SetPropertyValue<string>("ReadOnlyProperty", value); }
        }
        public string ProtectedProperty1
        {
            get { return GetPropertyValue<string>("ProtectedProperty1"); }
            set { SetPropertyValue<string>("ProtectedProperty1", value); }
        }
        public string ProtectedProperty2
        {
            get { return GetPropertyValue<string>("ProtectedProperty2"); }
            set { SetPropertyValue<string>("ProtectedProperty2", value); }
        }
    }

}
